A data communication system is a system or facility capable of providing information transfer between persons and equipment. The system usually consists of a collection of individual communication networks, transmission systems, relay stations, tributary stations, and terminal equipment capable of interconnection and interoperation so as to form an integrated whole. These individual components normally serve a common purpose, are technically compatible, employ common procedures, respond to some form of control, and generally operate in unison. Data communication systems can also be formed by a hardware connector used to link to other devices, or a convention used to allow communication between two software systems. Furthermore, such systems might be composed of several discrete units or devices or it might be integrated on one single semiconductor device.
When transferring data from one device to another through a data communication system, there might be differences in the rate of flow of data, in the time of an occurrence of events or in the size of blocks of data.
In order to compensate for such a difference a routine or storage is used generally referred to as a buffer. Hence, buffers are used to decouple processes so that a reader and a writer may operate at different speeds or on different sized blocks of data. The speed or the different sized blocks of data can be specified by parameters, e.g., incoming and outgoing bit rate, data width, block size, packet size.
Typically, a buffer will have additional attributes such as an input pointer, where new data will be written into the buffer, and output pointer, where the next item will be read out from and/or a count of the space used or free. Furthermore, there are many different algorithms for using buffers, e.g., first-in first-out (FIFO or shelf), last-in first-out (LIFO or stack), double buffering, i.e., allowing one buffer to be read while the other is being written and cyclic buffer, i.e., reading or writing past the end wraps around to the beginning.
While the use of buffers makes it possible to decouple processes so that a reader and a writer may operate at different speeds or on different sized blocks of data, they might be the reason for unwanted exceptional situations. One is called “buffer overflow”. This is what happens when it is tried to store more data in a buffer than it can handle. This may be due to a mismatch in the processing rates of the producing and consuming processes, or because the buffer is simply too small to hold all the data that must accumulate before a piece of it can be processed. For example, in a text-processing tool that crunches a line at a time, a short line buffer can result in a loss as input from a long line overflows the buffer and overwrites data beyond it. Therefore, additional measures need to be applied that check for overflow on each character and stop accepting data when the buffer is full.
Another unwanted exceptional situation is called “buffer overrun”. This is a frequent consequence of data arriving faster than it can be consumed, especially in serial line communications. For example, a communication line operated at 9600 baud, there is almost exactly one character per millisecond, so if a silo can hold only two characters and the machine takes longer than 2 milliseconds to get to service the interrupt, at least one character will be lost. However, the opposite, called “buffer underrun”, also must be avoided in order to ensure data integrity. This occurs when data are read faster from the buffer than written into it. Thus, additional precautionary measures must be taken.
From U.S. Pat. No. 5,765,187 an overrun and underrun detection circuit is known. The circuit detects a situation in which an overrun or an underrun will occur in the buffer area in response to the write address indicated by a write pointer and a read address indicated by a read pointer. A control part disables the data from being written into and read out from the buffer area when the overrun and underrun detection circuit detects the situation. Therefore, a receiving ring buffer control mechanism in a parallel computer system is provided in which a plurality of processors is connected to each other via a network. Each processor comprises a main memory having a buffer area serving as a receiving buffer. Data are applied to the main memory via a bus. A write pointer is coupled to the main memory for indicating a write address of the buffer area and a read pointer is coupled to the main memory for indicating a read address of the buffer area. An overrun and underrun detector is coupled to the write pointer and the read pointer for detecting a situation in which an overrun or an underrun will occur in the buffer area in response to the write address indicated by the write pointer and the read address indicated by the read pointer. Furthermore, a single DMA controller is coupled to the main memory and the overrun and underrun detector for preventing the data from being written into and read out from the buffer area when the overrun and underrun detector detects the situation.
U.S. Pat. No. 5,778,175 discloses a method implemented by a computer network adapter for automatic retransmission of any packet involved in an unsuccessful transmission attempt due to transmit buffer underrun conditions. The method entails the steps of stopping the transmission and retrying another transmission of the packet for up to a predetermined number of attempts with an increased transmit threshold. The transmit threshold is the number of bytes of data of the packet involved in the transmission that are stored in the transmit buffer prior to start of transmission. Preferably, for the initial transmission attempt, the adapter requires only a small number of bytes of the packet to be stored in the transmit buffer. After occurrence of a buffer underrun condition, the adapter attempts a retry in accordance with the algorithm only after a substantially larger portion of the packet has entered the transmit buffer for transmission. If any retry succeeds, the adapter need not issue an interrupt.
Both known approaches cause a delay in the data transmission. Either the data transfer is stopped when a buffer underrun has been detected or the transmission is retried up to a certain number of times to overcome the underrun condition.